package middleware

import "net/http"

type HandlerFunc func(http.Handler) http.Handler

type HandlerChain []HandlerFunc

func (h HandlerChain) Chain() HandlerFunc {
	return func(next http.Handler) http.Handler {
		for i := len(h) - 1; i >= 0; i-- {
			next = h[i](next)
		}
		return next
	}
}
